package com.chixing.work_05;

public class staticcc {
//    private static staticcc stac= new staticcc();
//    public int a ;
//    private staticcc(){
//
//    }
//    public static staticcc getStac(){
//        return stac;
//    }
//
//    public static void main(String[] args) {
//        staticcc d1 = staticcc.getStac();
//        staticcc d2 = staticcc.getStac();
//        d2.a = 100;
//        System.out.println(d1.a);
//    }

    static int i = 0;
    private staticcc(){}
    public int a ;

    public static staticcc newStaticcc(){
        staticcc.i++;
        if (staticcc.i >1)
            return null;
        return new staticcc();
    }

    public static void main(String[] args) {
        staticcc st = staticcc.newStaticcc();
        staticcc st2 = staticcc.newStaticcc();
        st.a = 10;
        System.out.println(st.a);

    }
}
